# coding=utf-8

import base64
import requests

s = None
with open("test.jpg", 'rb') as f:
    b = base64.b64encode(f.read())
    s = b.decode()

'''
人脸搜索xiangji
'''

request_url = "https://aip.baidubce.com/rest/2.0/face/v3/search"
print(s)
params = "{\"image\":\""+ s +"\",\"image_type\":\"BASE64\",\"group_id_list\":\"test\",\"quality_control\":\"NONE\",\"liveness_control\":\"NONE\"}"
access_token = '24.ebb57b5eeb8bd68404afcaf1813ecec4.2592000.1622166362.282335-24071481'
request_url = request_url + "?access_token=" + access_token
headers = {'content-type': 'application/json'}
response = requests.post(request_url, data=params, headers=headers)
if response:
    print (response.json())